<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>后台管理</title>
<style type="text/css">
body {
	background-image: url(pictures/RJ7LI50Y{O3PB58KE_70L3Q.png);
}
</style>
<script type="text/javascript" language="javaScript">
	function showFrame() {
		document.getElementById("content_div").style.display = "none";
		document.getElementById("frame").style.display = "block";
	}
	function showDiv() {
		document.getElementById("frame").style.display = "none";
		document.getElementById("content_div").style.display = "block";
	}
</script>
</head>
<body>
	<div align="right">
		<c:choose>
			<c:when test="${user != null}">
				<c:out value="Hi，${user.name}"></c:out>
			</c:when>
			<c:otherwise>
				<a href="login.jsp">登录 </a>
				<a href="register.jsp">注册</a>
			</c:otherwise>
		</c:choose>
	</div>
	<center>
		<div>
			<table width=100% height="100" border="0" cellspacing="0">
				<tr>
					<td width="218"><img src="pictures/management.jpg" width=100%
						height="100" /></td>
					<td width="120" align="center" style="font-size: 23px"
						bgcolor="#999999"><a href="index.jsp">Home</a></td>
					<td width="120" align="center" style="font-size: 23px"
						bgcolor="#999999"><a href="upload.jsp" target="content_frame"
						onClick="showFrame()">Upload</a></td>
					<td width="120" align="center" style="font-size: 23px"
						bgcolor="#999999"><a href="listAllPaper" onClick="showDiv()">Manage
							File</a></td>
					<td width="120" align="center" style="font-size: 23px"
						bgcolor="#999999"><a href="listAllUser" onClick="showDiv()">Manage
							User</a></td>
				</tr>
			</table>
		</div>
		<div id="content_div">
			<c:if test="${fn:length(paperAllList)>0}">
				<table border="solid">
					<tr>
						<td>Topic</td>
						<td>Author</td>
						<td>Date</td>
						<td>System</td>
						<td>Category</td>
						<td></td>
					</tr>
					<c:forEach items="${paperAllList}" var="paper">
						<tr>
							<td>${paper.topic}</td>
							<td>${paper.author}</td>
							<td>${paper.date}</td>
							<td>${paper.system}</td>
							<td>${paper.category}</td>
							<td><a href="deletePaper?id=${paper.id}">删除</a>
						</tr>
					</c:forEach>
				</table>
			</c:if>
			<c:if test="${fn:length(userAllList)>0}">
				<table border="solid">
					<tr>
						<td>User ID</td>
						<td>User Name</td>
						<td></td>
					</tr>
					<c:forEach items="${userAllList}" var="user">
						<tr>
							<td>${user.id }</td>
							<td>${user.name}</td>
							<td><a href="deleteUser?id=${user.id}">删除</a>
						</tr>
					</c:forEach>
				</table>
			</c:if>
		</div>
		<div id="frame" style="display: none">
			<iframe name="content_frame" width=100% height="600"
				id="content_frame">
				<img src="pictures/QQ图片20160329144310.jpg" width="1079" height="600"
					align="right" />
			</iframe>
		</div>
	</center>
</body>
</html>